08. All Promises
All Promises
2.8 All Promises Quiz
Instructions
First, if you haven't already, read this and follow the instructions on working with the Exoplanet Explorer repo.
- Checkout the
all-startbranch and navigate toapp/scripts/app.js. - Use
Promise.all()to refactor the.mapcode by passingPromise.all()an array of Promises.- Each Promise will be executed in parallel.
- The return values will be returned in the same order as the Promises were created.
Hint: you'll probably still need to use .map.
Checkout the all-solution branch to see my code!
Cam says: did you notice the data was requested in a different order in the video? If you did, good eye. I changed the order of the array of URLs between filming this class and releasing it. The reason is that the first URL didn't have enough data to show the Earth and planet scale visualizer and I wanted it to show up.